<?php


namespace EasySwoole\EasySwoole;


use App\Release\Release;
use EasySwoole\EasySwoole\AbstractInterface\Event;
use EasySwoole\EasySwoole\Swoole\EventRegister;

class EasySwooleEvent implements Event
{
    public static function initialize()
    {
        date_default_timezone_set('Asia/Shanghai');
    }

    public static function mainServerCreate(EventRegister $register)
    {
        // TODO: Implement mainServerCreate() method.
        $processConfig = new \EasySwoole\Component\Process\Config([
            'processName' => 'Es-release', // 设置 自定义进程名称
            'processGroup' => 'Es-release', // 设置 自定义进程组名称
//            'enableCoroutine' => true, // 设置 自定义进程自动开启协程
        ]);

//        \EasySwoole\Component\Process\Manager::getInstance()->addProcess(new Release($processConfig));
        $process = new Release('Es-release');
        \EasySwoole\Component\Process\Manager::getInstance()->addProcess($process);
    }
}